// 测试后端连接
const fetch = require('node-fetch');

async function testConnection() {
  const urls = [
    'http://localhost:3000/health',
    'http://127.0.0.1:3000/health'
  ];

  for (const url of urls) {
    try {
      console.log(`测试连接: ${url}`);
      const response = await fetch(url);
      const data = await response.json();
      console.log(`✅ 成功:`, data);
    } catch (error) {
      console.log(`❌ 失败:`, error.message);
    }
  }
}

testConnection();